﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PDS2_Launcher
{
    public partial class NewUser : Form
    {
        public NewUser()
        {
            InitializeComponent();
        }
        
        //public DialogResult InputBox()
        //{
        //    button1.DialogResult = DialogResult.OK;

        //    return DialogResult;
        //}

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "")
                MessageBox.Show("Enter a valid name");
            else if (textBox1.Text.ToLower().Contains("ö") || textBox1.Text.ToLower().Contains("ä") || textBox1.Text.ToLower().Contains("å") || textBox1.Text.ToLower().Contains("-"))
            {
                MessageBox.Show("Enter a valid name");                
            }
            else
            {
                this.DialogResult = DialogResult.OK;
            }
            //else 
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }

        private void NewUser_Load(object sender, EventArgs e)
        {

        }
    }
}
